include('shared.lua');

SWEP.PrintName = "Hacker";
SWEP.Slot = 1;
SWEP.SlotPos = 2;
SWEP.DrawAmmo = false;
SWEP.DrawCrosshair = false;

function SWEP:DrawHUD()
	local hack = self:GetNetworkedFloat("hackProgress");
	local hackMax = self:GetNetworkedFloat("hackMax");
	
	local height = ScrH()/4;
	
	draw.RoundedBox(5, 0, ScrH()/2, 25, height, Color(100, 100, 100, 255));
	height = height * hack/hackMax;
	
	draw.RoundedBox(5, 0, ScrH()/2, 25, height, Color(255, 0, 0, 255));
	local percent = math.Round(hack/hackMax*100);
	draw.SimpleText(tostring(percent) .. "%", "ScoreboardText", 5, ScrH()/2+5, Color(255, 255, 255, 255), 0, 1);
end